<template>
  <div id='tmpl'>
        <div class="title">
            {{info.title}}
        </div>
        <span>{{info.add_time|datefmt("YYYY-MM-DD HH:mm:ss")}}</span>
        <span>{{info.click}}次浏览</span>
        <div v-html="info.content"></div>
        
            <comment :id="id"></comment>
  </div>
</template>
<script>
import {Toast} from "mint-ui";
import comment from "../subcom/comment.vue";
export default {
    components:{
        comment
    },
  data () {
    return {
        id:0,
        info:{}
    };
  },created(){
      this.id = this.$route.params.id;
      this.getinfo();
  },methods:{
      getinfo(){
          var url = "http://www.lovegf.cn:8899/api/getnew/"+this.id;
          this.$http.get(url).then(function(res){
              if(res.body.status !=0){
                    Toast(res.body.message);
                    return;
              }
              this.info = res.body.message[0];
          })
      }
  }
}
</script>
<style lang="css" scoped>
    .title{
        color:aquamarine;
        font-size: 20px;
    }
</style>